package boc.sx.gateway.convertor;

import boc.sx.gateway.util.Xml2MapUtil;
import com.alibaba.fastjson2.JSON;

import java.util.Map;

public class JsonToXmlConvertor implements IBaseConvertor{

    @Override
    public boolean support(String from, String to) {
        return false;
    }

    @Override
    public String convert(String target) {
        Xml2MapUtil xml2MapUtil = new Xml2MapUtil();
        Map parse = JSON.parseObject(target, Map.class);
        String xml = xml2MapUtil.multilayerMapToXml(parse, false);
        return xml;
    }
}
